# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.Partners.V2.Model.AvailableOffer do
  @moduledoc """
  Available Offers to be distributed.

  ## Attributes

  - available (integer()): The number of codes for this offer that are available for distribution. Defaults to: `null`.
  - countryOfferInfos ([CountryOfferInfo]): Offer info by country. Defaults to: `null`.
  - description (String.t): Description of the offer. Defaults to: `null`.
  - id (String.t): ID of this offer. Defaults to: `null`.
  - maxAccountAge (integer()): The maximum age of an account [in days] to be eligible. Defaults to: `null`.
  - name (String.t): Name of the offer. Defaults to: `null`.
  - offerLevel (String.t): Level of this offer. Defaults to: `null`.
    - Enum - one of [OFFER_LEVEL_UNSPECIFIED, OFFER_LEVEL_DENY_PROBLEM, OFFER_LEVEL_DENY_CONTRACT, OFFER_LEVEL_MANUAL, OFFER_LEVEL_LIMIT_0, OFFER_LEVEL_LIMIT_5, OFFER_LEVEL_LIMIT_15, OFFER_LEVEL_LIMIT_50]
  - offerType (String.t): Type of offer. Defaults to: `null`.
    - Enum - one of [OFFER_TYPE_UNSPECIFIED, OFFER_TYPE_SPEND_X_GET_Y, OFFER_TYPE_VIDEO, OFFER_TYPE_SPEND_MATCH]
  - qualifiedCustomer ([OfferCustomer]): Customers who qualify for this offer. Defaults to: `null`.
  - qualifiedCustomersComplete (boolean()): Whether or not the list of qualified customers is definitely complete. Defaults to: `null`.
  - showSpecialOfferCopy (boolean()): Should special text be shown on the offers page. Defaults to: `null`.
  - terms (String.t): Terms of the offer. Defaults to: `null`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :available => any(),
          :countryOfferInfos => list(GoogleApi.Partners.V2.Model.CountryOfferInfo.t()),
          :description => any(),
          :id => any(),
          :maxAccountAge => any(),
          :name => any(),
          :offerLevel => any(),
          :offerType => any(),
          :qualifiedCustomer => list(GoogleApi.Partners.V2.Model.OfferCustomer.t()),
          :qualifiedCustomersComplete => any(),
          :showSpecialOfferCopy => any(),
          :terms => any()
        }

  field(:available)
  field(:countryOfferInfos, as: GoogleApi.Partners.V2.Model.CountryOfferInfo, type: :list)
  field(:description)
  field(:id)
  field(:maxAccountAge)
  field(:name)
  field(:offerLevel)
  field(:offerType)
  field(:qualifiedCustomer, as: GoogleApi.Partners.V2.Model.OfferCustomer, type: :list)
  field(:qualifiedCustomersComplete)
  field(:showSpecialOfferCopy)
  field(:terms)
end

defimpl Poison.Decoder, for: GoogleApi.Partners.V2.Model.AvailableOffer do
  def decode(value, options) do
    GoogleApi.Partners.V2.Model.AvailableOffer.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Partners.V2.Model.AvailableOffer do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
